Title Banner

Previous Book Contents Book Index Next

Inside Macintosh: OpenDoc Class Reference /
Part 1 - Classes and Methods / ODLink


RegisterDependent

The RegisterDependent method puts the specified destination part on the list of parts to be notified whenever the link is updated.

void RegisterDependent (in ODPart clientPart, 
                        in ODUpdateID id);
clientPart
A reference to the destination part wishing to be notified of changes to the content of the link source.
id
The update ID of the content the specified part last read from the link source.
DISCUSSION
If your part is a destination of this link, you can call this method to register your part as a dependent of this link object. Dependent parts receive automatic notification of any changes to the link's content. You can remove your part from the list of dependents by calling the UnregisterDependent method.

You should call this method in your part's HandleEvent method after calling the ShowLinkDestinationInfo method if the user has requested automatic notification of updates and your part is not already a registered dependent of this link object.

If the link's current update ID differs from the id parameter, OpenDoc immediately calls the specified client part's LinkUpdated method. You should pass the constant kODUnknownUpdate as the value of the id parameter when the link is first created; doing so ensures that your part's LinkUpdated method is called.

IMPORTANT
You should not call this method if your part is already a registered dependent of this link object, for example, because your part contains another destination of link source corresponding to this link object.
EXCEPTIONS
kODErrBrokenLink
Internal error; the link-source object disconnected from its destinations.
kODErrCannotRegisterDependent
The link object is unable to register the specified part as a dependent at this time.
SEE ALSO
The ODUpdateID type (page 917).
The ODLink::GetUpdateID method (page 353).
The ODLink::ShowLinkDestinationInfo method (page 357).
The ODLink::UnregisterDependent method (page 361).
The ODPart::LinkUpdated method (page 533).
"Selection Info" on page 252 in OpenDoc Programmer's Guide.
"Automatic and Manual Updating" on page 372 in OpenDoc Programmer's Guide.
"Creating a Link at the Destination" on page 380 in OpenDoc Programmer's Guide.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
17 JUL 1996




Navigation graphic, see text links

Main | Page One | What's New | Apple Computer, Inc. | Find It | Contact Us | Help